
<template>
  <!-- alt + 上下键 -->
  <div>
    tree
    <el-tree
      :data="data12"
      :props="defaultProps"
      @node-click="handleNodeClick">
    </el-tree>
  </div>
</template>
<script>
export default {
  data () {
    return {
      data12: [// ctrl + d
        {
          name: '一级 1',
          children: [
            {
              name: '二级 1-1',
              children: [
                {
                  name: '三级 1-1-1'
                }
              ]
            }
          ]
        }
      ],
      defaultProps: {
        children: 'children',
        label: 'name'
      }
    }
  },
  methods: {
    handleNodeClick (data) {
      console.log(data)
    }
  }
}
</script>
